package com.chinasoft.movies.mapper;

import com.chinasoft.movies.pojo.DirectorByRevAndPop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DirectorByRevAndPopMapper {

    @Select("SELECT director, sum_revenue, avg_popularity " +
            "FROM directors_top10_by_revenue " +
            "UNION " +
            "SELECT director, sum_revenue, avg_popularity " +
            "FROM directors_top10_by_popularity " +
            "ORDER BY sum_revenue DESC, avg_popularity desc " )
    List<DirectorByRevAndPop> queryDirectorByRevAndPop();

}
